<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .bg{
            background-color: red;
        }
    </style>
</head>
<body>
    
    <div id="app" class="app" name="demo">
        This is my text test!
    </div>

    <input type="text" value="wwww" name="txt" id="">



    <script>
        var app=document.getElementById('app');
        app.title="轻轻的我走了，正如我轻轻的来";
        // app.className='bg';
        // app.classList.add('bg');
        // app.classList.remove('bg');
        app.onclick=function(){
            app.classList.toggle('bg');

        }
    </script>

</body>
</html>